import React from 'react';
import {withRouter } from 'react-router-dom'
import { connect } from 'react-redux'

import { Upload, message, Button, Icon } from 'antd';
const props = {
    name: 'file',
    action: 'http://www2.yihangotms.com/home/excel',
  };
@withRouter
@connect(
    state => state,
)
export default class Uplate extends React.Component{
    constructor(){
        super();
        this.state = {
            
        }
    }
    onChange(info) {
        if (info.file.status !== 'uploading') {
          console.log(info.file, info.fileList);
        }
        if (info.file.status === 'done') {
          message.success(`${info.file.name} file uploaded successfully`);
        } else if (info.file.status === 'error') {
          message.error(`${info.file.name} file upload failed.`);
        }
      }
   
   
   
    render() {
     
        return (
          <Upload {...props}>
            <Button>
            <Icon type="upload" /> Click to Upload
            </Button>
        </Upload>
    )
    }
}